package com.jerry.base.java8.lambda;

/**
 * 自定义函数式接口
 *
 * @author Jerry
 * @since 2024/7/31 16:50
 */
public class MethodRefExercise2 {

    record Color(Integer red, Integer green, Integer blue) {
    }

    public static void main(String[] args) {
        TernaryFunction function = Color::new;
        Color white = function.apply(255, 255, 255);
        System.out.println(white);
    }

    @FunctionalInterface
    interface TernaryFunction {

        Color apply(Integer red, Integer green, Integer blue);
    }
}
